function format_hm(time){
  if (!time) {
    time = 0;
  }
  time = parseInt(time / 1000);

  let h = parseInt(time / 3600);
  let m = parseInt(time % 3600 / 60);

  h = h < 10 ? ('0' + h) : h;
  m = m < 10 ? ('0' + m) : m;
  return h + ' :' + m;
}

module.exports = {
  format_hm: format_hm
}
